using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Silvery.Logs;

namespace Silvery.Command
{
    public class Cmd_Logs : StandardCommand
    {
        public Cmd_Logs()
        {
            this.Command = "logs";
            base.Instruction = "显示所有写入到log记录的信息";
        }
        public override void Execute(IGameCommandBox parent, string parameter)
        {
            if (NDebugLogs.Current.Count > 0)
            {
                parent.WriteLineToOutput("=+= Logs =+==========================");
                foreach (var item in NDebugLogs.Current)
                {
                    parent.WriteLineToOutput(item.ToString());
                }
                parent.WriteLineToOutput("===================================");
            }
            else
            {
                parent.WriteLineToOutput("=+= Logs =+==========================");
                parent.WriteLineToOutput("没有Logs");
                parent.WriteLineToOutput("===================================");
            }
            base.Execute(parent, parameter);
        }

    }
}
